package com.example.appforphysician.adapter;
import java.util.ArrayList;
import java.util.HashMap;

public class ServiceAdapter {
	private ArrayList<HashMap<String, String>> accountList;

	public ServiceAdapter() {
		accountList = new ArrayList<HashMap<String, String>>();
		HashMap<String, String> map = new HashMap<String, String>();
		map.put("nghith", "123");
		map.put("quocpt", "123");
		accountList.add(map);
	}

	public boolean authenticate(String username, String password) {
		if (username == null || password == null)
			return false;

		if (username.length() == 0 || password.length() == 0)
			return false;

		for (HashMap<String, String> acc : accountList) {
			if (acc.containsKey(username) && password.equals(acc.get(username)))
				return true;
		}

		return false;
	}

	// ========================================================

}
